package com.chidopi.market.aa.domain;

import java.util.Date;
import java.util.List;

import com.chidopi.cdf.domain.BaseVO;


public class Accounts extends BaseVO {
	public static final String ACCOUNT_PASSWORD_DEFAULT = "1234";
	private String username;
	private String password;
	private String enable_flag;
	private String name_tw;
	private String name_en;
	private String email;
	private Date effective_start_date;
	private Date effective_end_date;
	private Date lock_start_date;
	private Date lock_end_date;
	private Integer login_err_top;
	private Integer login_err_num;
	private String login_flag;
	private List<Roles> roles;

	public Accounts() {}

	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getEnable_flag() {
		if (enable_flag == null) return "N";
		return enable_flag;
	}
	public void setEnable_flag(String enableFlag) {
		enable_flag = enableFlag;
	}
	public String getName_tw() {
		return name_tw;
	}
	public void setName_tw(String nameTw) {
		name_tw = nameTw;
	}
	public String getName_en() {
		return name_en;
	}
	public void setName_en(String nameEn) {
		name_en = nameEn;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public Date getEffective_start_date() {
		return effective_start_date;
	}
	public void setEffective_start_date(Date effectiveStartDate) {
		effective_start_date = effectiveStartDate;
	}
	public Date getEffective_end_date() {
		return effective_end_date;
	}
	public void setEffective_end_date(Date effectiveEndDate) {
		effective_end_date = effectiveEndDate;
	}
	public Date getLock_start_date() {
		return lock_start_date;
	}
	public void setLock_start_date(Date lockStartDate) {
		lock_start_date = lockStartDate;
	}
	public Date getLock_end_date() {
		return lock_end_date;
	}
	public void setLock_end_date(Date lockEndDate) {
		lock_end_date = lockEndDate;
	}
	public Integer getLogin_err_top() {
		return login_err_top;
	}
	public void setLogin_err_top(Integer loginErrTop) {
		login_err_top = loginErrTop;
	}
	public Integer getLogin_err_num() {
		return login_err_num;
	}
	public void setLogin_err_num(Integer loginErrNum) {
		login_err_num = loginErrNum;
	}
	public String getLogin_flag() {
		if (login_flag == null) return "N";
		return login_flag;
	}
	public void setLogin_flag(String loginFlag) {
		login_flag = loginFlag;
	}
	
	public boolean isPassNeedEncode(){
		return null == password || ACCOUNT_PASSWORD_DEFAULT.equals(password);
	}

	public List<Roles> getRoles() {
		return roles;
	}

	public void setRoles(List<Roles> roles) {
		this.roles = roles;
	}
}
